#include <iostream>
#include "Thread.hpp"
#include <unistd.h>
using namespace std;
void run(void *arg)
{
    int cnt = 10;
    while (cnt--)
    {
        cout << "我是新线程,"<< "message:" << (char *)arg <<",cnt:"<<cnt<< endl;
        sleep(1);
    }
}
int main()
{
    Thread t1(1, run, (void *)"hello lnb");
    cout<<"我是main线程，新线程的名字："<<t1.name()<<",status:"<<t1.ThreadStatus()<<",tid:"<<t1.ThreadTid()<<endl;
    t1.Run();
    cout<<"我是main线程，新线程的名字："<<t1.name()<<",status:"<<t1.ThreadStatus()<<",tid:"<<t1.ThreadTid()<<endl;
    t1.join();
    cout<<"我是main线程，新线程的名字："<<t1.name()<<",status:"<<t1.ThreadStatus()<<",tid:"<<t1.ThreadTid()<<endl;
    return 0;
}